package com.consumer.controller;


import com.consumer.client.ProducerFeign;
import com.consumer.entity.UserEneity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/user")
public class ConsumerUserController {

    @Resource
    private ProducerFeign requestFeign;
    @GetMapping("/getUserAll")
    public ResponseEntity<List<UserEneity>> getUserAll(){
        List<UserEneity> all = requestFeign.getAll();
        return ResponseEntity.ok(all);
    }

}
